<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>beagleoncreate: D:/backups/Desktop/beagleoncreate/trunk/main.cpp File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">beagleoncreate
   
   </div>
   <div id="projectbrief">Beagleboard sensor interface on iRobot Create with sonar and USB webcam through WiFi</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('main_8cpp.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">D:/backups/Desktop/beagleoncreate/trunk/main.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;sys/types.h&gt;</code><br/>
<code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &lt;unistd.h&gt;</code><br/>
<code>#include &lt;sys/socket.h&gt;</code><br/>
<code>#include &lt;netinet/in.h&gt;</code><br/>
<code>#include &lt;string.h&gt;</code><br/>
<code>#include &lt;netdb.h&gt;</code><br/>
<code>#include &lt;stdio.h&gt;</code><br/>
<code>#include &lt;iostream&gt;</code><br/>
<code>#include &lt;pthread.h&gt;</code><br/>
<code>#include &lt;sys/resource.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="_packet_8h_source.html">Packet.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_control_8h_source.html">control/Control.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_camera_8h_source.html">camera/Camera.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_create_8h_source.html">create/Create.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_sonar_8h_source.html">sonar/Sonar.h</a>&quot;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#aacbf7158b3cfc03ef64cbc33fbb25d6e">BEAGLE_PORT</a>&#160;&#160;&#160;8866</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a7fdd22e9b24d50007f16b2459881448f">SONAR_GPIO1</a>&#160;&#160;&#160;136</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a723288cb72f0a26c1eb0a708c29d9c29">SONAR_GPIO2</a>&#160;&#160;&#160;135</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#afaa329ef57165de01f9b8d7035953277">SONAR_GPIO3</a>&#160;&#160;&#160;134</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#af77ed3e65a7b1a9341603d152a1404df">MAXPENDING</a>&#160;&#160;&#160;1</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a4866b2d37ffc80c5ba705d3fcd1e0ecf">error</a> (const char *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The error printing function.  <a href="#a4866b2d37ffc80c5ba705d3fcd1e0ecf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#adf227e41a788523dedbe0276debe5393">debugMsg</a> (const char *func, const char *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to print debug message.  <a href="#adf227e41a788523dedbe0276debe5393"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a917293b77eb233bfb2261a6cba85e5cc">HandleControls</a> (<a class="el" href="struct_packet.html">Packet</a> &amp;packet)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles the control for the universal gripper.  <a href="#a917293b77eb233bfb2261a6cba85e5cc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a450118b81fa27f95cc7eee4ecd0c95c7">RunARtagVideo</a> (void *arg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Start running <a class="el" href="class_a_rtag.html" title="ARtag class which holds information like tag ID and pose matrix for the ARtag.">ARtag</a> detection.  <a href="#a450118b81fa27f95cc7eee4ecd0c95c7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a9a6055e981ba90bd89279a54e6698aca">CreateSerialHandler</a> (void *arg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Start running serial handler for iRobot <a class="el" href="class_create.html" title="This class handles all serial communication with iRobot Create.">Create</a>.  <a href="#a9a6055e981ba90bd89279a54e6698aca"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a1ad855125423931c3be573f46ae0b45f">CreateTCPListener</a> (void *arg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Start running TCP listener for iRobot <a class="el" href="class_create.html" title="This class handles all serial communication with iRobot Create.">Create</a>.  <a href="#a1ad855125423931c3be573f46ae0b45f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a2ccbff8a4a07a3866042e3995f47b6aa">SonarSender</a> (void *arg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Start running sonar measurement and send over the measurement through udp.  <a href="#a2ccbff8a4a07a3866042e3995f47b6aa"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#aa1dea95e97e782da0ef6d03c3a331891">Dumbload</a> (void *arg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Start running dumb load which peg the cpu load at 99%.  <a href="#aa1dea95e97e782da0ef6d03c3a331891"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a8d6969d48ec91d4105a9d8b2017934f0">StreamSensorData</a> (void *arg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Start streaming all the sensor data including sonar, artag, and create.  <a href="#a8d6969d48ec91d4105a9d8b2017934f0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a0ba386b0774ebb834a1c15a0e6e23de9">MakeConnection</a> (<a class="el" href="struct_packet.html">Packet</a> &amp;packet)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Making the connection after the init packet is received. Start streaming sensor data.  <a href="#a0ba386b0774ebb834a1c15a0e6e23de9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a75604a14ae99c62c591eeecfe48db860">ProcessPackets</a> (<a class="el" href="struct_packet.html">Packet</a> &amp;packet)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Process the <a class="el" href="struct_packet.html" title="This struct defines the packet structure.">Packet</a> that is received based on its PacketType.  <a href="#a75604a14ae99c62c591eeecfe48db860"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a8541776240bdbb4306faf4c1b35f16cd">ListenMessage</a> (void *arg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Start listening to any packet coming in from the remote host.  <a href="#a8541776240bdbb4306faf4c1b35f16cd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97">main</a> (int argc, char *argv[])</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The "main" function, start the listener thread.  <a href="#a0ddf1224851353fc92bfbff6f499fa97"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a2b0ff7ec87d61d6752221d0652e4728a">showDebugMsg</a> = true</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">pthread_cond_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a53aa47fcf54423bd3f848f4587509d61">endCondition</a> = PTHREAD_COND_INITIALIZER</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">pthread_mutex_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#ab2f7c1ef4827c26bda76b5ce7152e415">endMutex</a> = PTHREAD_MUTEX_INITIALIZER</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a7a07acedc029e72784867cbe9ac10543">isInit</a> = false</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a66f5535f0e62be5a5a81fa16bd593e50">isEnding</a> = false</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a1ae33166c94018e9d335254de88590c8">remoteSockUDP</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct sockaddr_in&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a1258d663950eac9f76fd081019ff0a70">remoteVideo</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct sockaddr_in&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a891007f7c96cc434d8a57eed881f75a6">remoteARtag</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct sockaddr_in&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a9907f8adf67505049422ed048afebe9a">remoteSonar</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">pthread_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#ac9cbb61449fe1bafda238aa804fdae32">sensorThread</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_camera.html">Camera</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#af95833c961e5bd20dcd54e1d46a03c0b">camera</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_create.html">Create</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#aa4f3174a135d2dc2429f749319277f00">create</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_sonar.html">Sonar</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a4e0e038188ccf38607857c41d6974ce2">sonar1</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_sonar.html">Sonar</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#ab6780162a9eed1218cde4b8356c4ca8a">sonar2</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_sonar.html">Sonar</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a96ba31879fb73cd5c8b4a94e8921a7ac">sonar3</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"></div><hr/><h2>Define Documentation</h2>
<a class="anchor" id="aacbf7158b3cfc03ef64cbc33fbb25d6e"></a><!-- doxytag: member="main.cpp::BEAGLE_PORT" ref="aacbf7158b3cfc03ef64cbc33fbb25d6e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="main_8cpp.html#aacbf7158b3cfc03ef64cbc33fbb25d6e">BEAGLE_PORT</a>&#160;&#160;&#160;8866</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The udp port number for talking with this program. </p>

</div>
</div>
<a class="anchor" id="af77ed3e65a7b1a9341603d152a1404df"></a><!-- doxytag: member="main.cpp::MAXPENDING" ref="af77ed3e65a7b1a9341603d152a1404df" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="main_8cpp.html#af77ed3e65a7b1a9341603d152a1404df">MAXPENDING</a>&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Max connection requests </p>

</div>
</div>
<a class="anchor" id="a7fdd22e9b24d50007f16b2459881448f"></a><!-- doxytag: member="main.cpp::SONAR_GPIO1" ref="a7fdd22e9b24d50007f16b2459881448f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="main_8cpp.html#a7fdd22e9b24d50007f16b2459881448f">SONAR_GPIO1</a>&#160;&#160;&#160;136</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The gpio pin number that sonar 1 is connected to. </p>

</div>
</div>
<a class="anchor" id="a723288cb72f0a26c1eb0a708c29d9c29"></a><!-- doxytag: member="main.cpp::SONAR_GPIO2" ref="a723288cb72f0a26c1eb0a708c29d9c29" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="main_8cpp.html#a723288cb72f0a26c1eb0a708c29d9c29">SONAR_GPIO2</a>&#160;&#160;&#160;135</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The gpio pin number that sonar 2 is connected to. </p>

</div>
</div>
<a class="anchor" id="afaa329ef57165de01f9b8d7035953277"></a><!-- doxytag: member="main.cpp::SONAR_GPIO3" ref="afaa329ef57165de01f9b8d7035953277" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="main_8cpp.html#afaa329ef57165de01f9b8d7035953277">SONAR_GPIO3</a>&#160;&#160;&#160;134</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The gpio pin number that sonar 3 is connected to. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a9a6055e981ba90bd89279a54e6698aca"></a><!-- doxytag: member="main.cpp::CreateSerialHandler" ref="a9a6055e981ba90bd89279a54e6698aca" args="(void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="main_8cpp.html#a9a6055e981ba90bd89279a54e6698aca">CreateSerialHandler</a> </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Start running serial handler for iRobot <a class="el" href="class_create.html" title="This class handles all serial communication with iRobot Create.">Create</a>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>Any possible argument that is passed in with this thread. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1ad855125423931c3be573f46ae0b45f"></a><!-- doxytag: member="main.cpp::CreateTCPListener" ref="a1ad855125423931c3be573f46ae0b45f" args="(void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="main_8cpp.html#a1ad855125423931c3be573f46ae0b45f">CreateTCPListener</a> </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Start running TCP listener for iRobot <a class="el" href="class_create.html" title="This class handles all serial communication with iRobot Create.">Create</a>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>Any possible argument that is passed in with this thread. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adf227e41a788523dedbe0276debe5393"></a><!-- doxytag: member="main.cpp::debugMsg" ref="adf227e41a788523dedbe0276debe5393" args="(const char *func, const char *msg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="main_8cpp.html#adf227e41a788523dedbe0276debe5393">debugMsg</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>msg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A function to print debug message. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">func</td><td>the function name. (put __FUNC__ macro) </td></tr>
    <tr><td class="paramname">msg</td><td>any message you desire. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa1dea95e97e782da0ef6d03c3a331891"></a><!-- doxytag: member="main.cpp::Dumbload" ref="aa1dea95e97e782da0ef6d03c3a331891" args="(void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="main_8cpp.html#aa1dea95e97e782da0ef6d03c3a331891">Dumbload</a> </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Start running dumb load which peg the cpu load at 99%. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>Any possible argument that is passed in with this thread. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4866b2d37ffc80c5ba705d3fcd1e0ecf"></a><!-- doxytag: member="main.cpp::error" ref="a4866b2d37ffc80c5ba705d3fcd1e0ecf" args="(const char *msg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="main_8cpp.html#a4866b2d37ffc80c5ba705d3fcd1e0ecf">error</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The error printing function. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">msg</td><td>the msg to print out. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a917293b77eb233bfb2261a6cba85e5cc"></a><!-- doxytag: member="main.cpp::HandleControls" ref="a917293b77eb233bfb2261a6cba85e5cc" args="(Packet &amp;packet)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="main_8cpp.html#a917293b77eb233bfb2261a6cba85e5cc">HandleControls</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_packet.html">Packet</a> &amp;&#160;</td>
          <td class="paramname"><em>packet</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Handles the control for the universal gripper. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">packet</td><td>The <a class="el" href="struct_packet.html" title="This struct defines the packet structure.">Packet</a> received. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8541776240bdbb4306faf4c1b35f16cd"></a><!-- doxytag: member="main.cpp::ListenMessage" ref="a8541776240bdbb4306faf4c1b35f16cd" args="(void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="main_8cpp.html#a8541776240bdbb4306faf4c1b35f16cd">ListenMessage</a> </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Start listening to any packet coming in from the remote host. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>Any possible argument that is passed in with this thread. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a0ddf1224851353fc92bfbff6f499fa97"></a><!-- doxytag: member="main.cpp::main" ref="a0ddf1224851353fc92bfbff6f499fa97" args="(int argc, char *argv[])" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="main_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97">main</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>argv</em>[]&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The "main" function, start the listener thread. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">argc</td><td>The argument size. </td></tr>
    <tr><td class="paramname">argv</td><td>The argument value. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 when done. </dd></dl>

</div>
</div>
<a class="anchor" id="a0ba386b0774ebb834a1c15a0e6e23de9"></a><!-- doxytag: member="main.cpp::MakeConnection" ref="a0ba386b0774ebb834a1c15a0e6e23de9" args="(Packet &amp;packet)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="main_8cpp.html#a0ba386b0774ebb834a1c15a0e6e23de9">MakeConnection</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_packet.html">Packet</a> &amp;&#160;</td>
          <td class="paramname"><em>packet</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Making the connection after the init packet is received. Start streaming sensor data. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">packet</td><td>The <a class="el" href="struct_packet.html" title="This struct defines the packet structure.">Packet</a> received. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a75604a14ae99c62c591eeecfe48db860"></a><!-- doxytag: member="main.cpp::ProcessPackets" ref="a75604a14ae99c62c591eeecfe48db860" args="(Packet &amp;packet)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="main_8cpp.html#a75604a14ae99c62c591eeecfe48db860">ProcessPackets</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_packet.html">Packet</a> &amp;&#160;</td>
          <td class="paramname"><em>packet</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Process the <a class="el" href="struct_packet.html" title="This struct defines the packet structure.">Packet</a> that is received based on its PacketType. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">packet</td><td>The <a class="el" href="struct_packet.html" title="This struct defines the packet structure.">Packet</a> received. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a450118b81fa27f95cc7eee4ecd0c95c7"></a><!-- doxytag: member="main.cpp::RunARtagVideo" ref="a450118b81fa27f95cc7eee4ecd0c95c7" args="(void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="main_8cpp.html#a450118b81fa27f95cc7eee4ecd0c95c7">RunARtagVideo</a> </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Start running <a class="el" href="class_a_rtag.html" title="ARtag class which holds information like tag ID and pose matrix for the ARtag.">ARtag</a> detection. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>Any possible argument that is passed in with this thread. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2ccbff8a4a07a3866042e3995f47b6aa"></a><!-- doxytag: member="main.cpp::SonarSender" ref="a2ccbff8a4a07a3866042e3995f47b6aa" args="(void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="main_8cpp.html#a2ccbff8a4a07a3866042e3995f47b6aa">SonarSender</a> </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Start running sonar measurement and send over the measurement through udp. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>Any possible argument that is passed in with this thread. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8d6969d48ec91d4105a9d8b2017934f0"></a><!-- doxytag: member="main.cpp::StreamSensorData" ref="a8d6969d48ec91d4105a9d8b2017934f0" args="(void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="main_8cpp.html#a8d6969d48ec91d4105a9d8b2017934f0">StreamSensorData</a> </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Start streaming all the sensor data including sonar, artag, and create. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>Any possible argument that is passed in with this thread. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="af95833c961e5bd20dcd54e1d46a03c0b"></a><!-- doxytag: member="main.cpp::camera" ref="af95833c961e5bd20dcd54e1d46a03c0b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_camera.html">Camera</a>* <a class="el" href="main_8cpp.html#af95833c961e5bd20dcd54e1d46a03c0b">camera</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The camera object for <a class="el" href="class_a_rtag.html" title="ARtag class which holds information like tag ID and pose matrix for the ARtag.">ARtag</a> detection. </p>

</div>
</div>
<a class="anchor" id="aa4f3174a135d2dc2429f749319277f00"></a><!-- doxytag: member="main.cpp::create" ref="aa4f3174a135d2dc2429f749319277f00" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_create.html">Create</a>* <a class="el" href="main_8cpp.html#aa4f3174a135d2dc2429f749319277f00">create</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The create object for iRobot <a class="el" href="class_create.html" title="This class handles all serial communication with iRobot Create.">Create</a> teleop. </p>

</div>
</div>
<a class="anchor" id="a53aa47fcf54423bd3f848f4587509d61"></a><!-- doxytag: member="main.cpp::endCondition" ref="a53aa47fcf54423bd3f848f4587509d61" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">pthread_cond_t <a class="el" href="main_8cpp.html#a53aa47fcf54423bd3f848f4587509d61">endCondition</a> = PTHREAD_COND_INITIALIZER</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The end condition to signal quitting of the program. </p>

</div>
</div>
<a class="anchor" id="ab2f7c1ef4827c26bda76b5ce7152e415"></a><!-- doxytag: member="main.cpp::endMutex" ref="ab2f7c1ef4827c26bda76b5ce7152e415" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">pthread_mutex_t <a class="el" href="main_8cpp.html#ab2f7c1ef4827c26bda76b5ce7152e415">endMutex</a> = PTHREAD_MUTEX_INITIALIZER</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The mutex for the end condition. </p>

</div>
</div>
<a class="anchor" id="a66f5535f0e62be5a5a81fa16bd593e50"></a><!-- doxytag: member="main.cpp::isEnding" ref="a66f5535f0e62be5a5a81fa16bd593e50" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="main_8cpp.html#a66f5535f0e62be5a5a81fa16bd593e50">isEnding</a> = false</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Flag to get ready to quit the program. </p>

</div>
</div>
<a class="anchor" id="a7a07acedc029e72784867cbe9ac10543"></a><!-- doxytag: member="main.cpp::isInit" ref="a7a07acedc029e72784867cbe9ac10543" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="main_8cpp.html#a7a07acedc029e72784867cbe9ac10543">isInit</a> = false</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Flag to indicate that the program has initialized. </p>

</div>
</div>
<a class="anchor" id="a891007f7c96cc434d8a57eed881f75a6"></a><!-- doxytag: member="main.cpp::remoteARtag" ref="a891007f7c96cc434d8a57eed881f75a6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct sockaddr_in <a class="el" href="main_8cpp.html#a891007f7c96cc434d8a57eed881f75a6">remoteARtag</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The sockaddr_in struct that is associated with the <a class="el" href="class_a_rtag.html" title="ARtag class which holds information like tag ID and pose matrix for the ARtag.">ARtag</a> udp port. </p>

</div>
</div>
<a class="anchor" id="a1ae33166c94018e9d335254de88590c8"></a><!-- doxytag: member="main.cpp::remoteSockUDP" ref="a1ae33166c94018e9d335254de88590c8" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="main_8cpp.html#a1ae33166c94018e9d335254de88590c8">remoteSockUDP</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The remote UDP socket file descriptor. </p>

</div>
</div>
<a class="anchor" id="a9907f8adf67505049422ed048afebe9a"></a><!-- doxytag: member="main.cpp::remoteSonar" ref="a9907f8adf67505049422ed048afebe9a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct sockaddr_in <a class="el" href="main_8cpp.html#a9907f8adf67505049422ed048afebe9a">remoteSonar</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The sockaddr_in struct that is associated with the <a class="el" href="class_sonar.html" title="This class is the class handle sonar related stuff.">Sonar</a> udp port. </p>

</div>
</div>
<a class="anchor" id="a1258d663950eac9f76fd081019ff0a70"></a><!-- doxytag: member="main.cpp::remoteVideo" ref="a1258d663950eac9f76fd081019ff0a70" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct sockaddr_in <a class="el" href="main_8cpp.html#a1258d663950eac9f76fd081019ff0a70">remoteVideo</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The sockaddr_in struct that is associated with the video udp port. </p>

</div>
</div>
<a class="anchor" id="ac9cbb61449fe1bafda238aa804fdae32"></a><!-- doxytag: member="main.cpp::sensorThread" ref="ac9cbb61449fe1bafda238aa804fdae32" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">pthread_t <a class="el" href="main_8cpp.html#ac9cbb61449fe1bafda238aa804fdae32">sensorThread</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The sensor thread for streaming all sensor data to the MATLAB. </p>

</div>
</div>
<a class="anchor" id="a2b0ff7ec87d61d6752221d0652e4728a"></a><!-- doxytag: member="main.cpp::showDebugMsg" ref="a2b0ff7ec87d61d6752221d0652e4728a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="main_8cpp.html#a2b0ff7ec87d61d6752221d0652e4728a">showDebugMsg</a> = true</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Flag to show debug message. </p>

</div>
</div>
<a class="anchor" id="a4e0e038188ccf38607857c41d6974ce2"></a><!-- doxytag: member="main.cpp::sonar1" ref="a4e0e038188ccf38607857c41d6974ce2" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_sonar.html">Sonar</a>* <a class="el" href="main_8cpp.html#a4e0e038188ccf38607857c41d6974ce2">sonar1</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The sonar object for sonar 1. </p>

</div>
</div>
<a class="anchor" id="ab6780162a9eed1218cde4b8356c4ca8a"></a><!-- doxytag: member="main.cpp::sonar2" ref="ab6780162a9eed1218cde4b8356c4ca8a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_sonar.html">Sonar</a>* <a class="el" href="main_8cpp.html#ab6780162a9eed1218cde4b8356c4ca8a">sonar2</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The sonar object for sonar 2. </p>

</div>
</div>
<a class="anchor" id="a96ba31879fb73cd5c8b4a94e8921a7ac"></a><!-- doxytag: member="main.cpp::sonar3" ref="a96ba31879fb73cd5c8b4a94e8921a7ac" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_sonar.html">Sonar</a>* <a class="el" href="main_8cpp.html#a96ba31879fb73cd5c8b4a94e8921a7ac">sonar3</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The sonar object for sonar 3. </p>

</div>
</div>
</div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="main_8cpp.html">main.cpp</a>      </li>

    <li class="footer">Generated on Sun Feb 12 2012 18:23:34 for beagleoncreate by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
